<template>
  <img alt="Vue logo" :src="logImg" />
  <img src="~/../assets/logo.png" style="width: 40px; height: 40px">
  <HelloWorld msg="Hello Vue 3 + Vite" />
  <hr>
  <!-- 添加 dirctive 刷新机制 -->
  <div v-rx-reload>Multi page entry</div>
  <button @click="onPush('about')">about</button>
  <hr>
  <button @click="onPush('vroute')">vroute</button>
</template>

<script setup>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from '../components/HelloWorld.vue'

import { getCurrentInstance } from 'vue'
import navPush from '../utils/navigator'
import GetImgUrl from '@/utils/img-url'

const logImg = GetImgUrl('logo.png')

const that = getCurrentInstance()
const onPush = (page) => {
  navPush(that, { name: page })
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
